package com.atguigu.crowd.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.atguigu.crowd.entity.vo.OrderVO;
import com.atguigu.crowd.mapper.OrderMapper;
import com.atguigu.crowd.service.api.OrderService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

@Service
public class OrderServiceImpl implements OrderService {

	@Autowired
	private OrderMapper orderMapper; 
	
	@Override
	public OrderVO getOrderDetail(Integer orderId) {
		return orderMapper.selectOrderDetailByOrderId(orderId);
	}

	@Override
	public PageInfo<OrderVO> getPageInfo(Integer pageNum, Integer pageSize, String keyword) {
		PageHelper.startPage(pageNum, pageSize);
		List<OrderVO> orderList = orderMapper.selectOrderDetailByKeyword(keyword);
		return new PageInfo<>(orderList);
	}

}
